#ifndef THREAD_MANAGER_H
#define THREAD_MANAGER_H


class Thread_Manager
{
public:
	Thread_Manager () {};

	static void spawn (void *(*entry_point_function) (void *),
		        void *arg = 0, long flags = 0,
				long stack_size = 0,
				void *stack_pointer = 0,
				void *t_id = 0)
	{
		DWORD t;
		if (t_id != 0) t_id = &t;

		CreateThread(0, 0, 
			         LPTHREAD_START_ROUTINE(entry_point_function),
					 arg, 0, &t);
	}

	static int self(void)
	{
		return GetCurrentThreadId();
	}

	static Thread_Manager* instance(void)
	{
		if (threadManager == NULL)
			threadManager = new Thread_Manager();
		return threadManager;
	}

public:
	static Thread_Manager* threadManager;
};

#endif